package br.fmapn.reporter.util;

import java.text.DecimalFormat;


public class MappingEffiencienceReport {

	private int numberOfSessions;
	private int numberExecutionsNotMapped;
	
	private int numberExecutionsMapped;
	
	public void setNumberExecutionsMapped(int numberExecutionsMapped) {
		this.numberExecutionsMapped = numberExecutionsMapped;
	}
	public int getNumberExecutionsMapped() {
		return numberExecutionsMapped;
	}
	public void setNumberExecutionsNotMapped(int numberExecutionsNotMapped) {
		this.numberExecutionsNotMapped = numberExecutionsNotMapped;
	}
	public int getNumberExecutionsNotMapped() {
		return numberExecutionsNotMapped;
	}
	
	public int getNumberExecutions(){
		return (numberExecutionsMapped + numberExecutionsNotMapped);
	}
	
	public String getEfficience(){
		if(getNumberExecutions() == 0 && getNumberExecutionsMapped() == 0 ){
			return "0";
		}
		double mapped = getNumberExecutionsMapped();
		double executed = getNumberExecutions();
		double resultado = (mapped/executed)*100;
		DecimalFormat format = new DecimalFormat("##.#");
		//resultado= resultado *100;
		return format.format(resultado);
	}
	public void setNumberOfSessions(int numberOfSessions) {
		this.numberOfSessions = numberOfSessions;
	}
	public int getNumberOfSessions() {
		return numberOfSessions;
	}
	
	
}
